package com.zhiche.lisa.bms.service.statistics.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zhiche.lisa.bms.dao.mapper.statistics.StaticDeleteWaybillMapper;
import com.zhiche.lisa.bms.dao.model.statistics.StaticDeleteWaybill;
import com.zhiche.lisa.bms.pojo.bo.statistics.DeletedWaybillBO;
import com.zhiche.lisa.bms.service.statistics.StaticDeleteWaybillService;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 * 指令删除表 服务实现类
 * </p>
 *
 * @author liangpeng
 * @since 2019-02-18
 */
@Service
public class StaticDeleteWaybillServiceImpl extends ServiceImpl<StaticDeleteWaybillMapper, StaticDeleteWaybill> implements StaticDeleteWaybillService {

    @Override
    public List<DeletedWaybillBO> getStaticDeleteWayBill(int intCount) {
        EntityWrapper<DeletedWaybillBO> ewDeleteWaybillBO = new EntityWrapper<>();
        ewDeleteWaybillBO.eq("deal_status",0);
        ewDeleteWaybillBO.orderBy("gmt_modify");
        if(intCount > 0){
            ewDeleteWaybillBO.last("limit " + intCount);
        }
        return baseMapper.getStaticDeletedWayBillBO(ewDeleteWaybillBO);
    }

}
